//
//  MCPersonInformationFooterView.m
//  TLYL
//
//  Created by MC on 2017/6/14.
//  Copyright © 2017年 TLYL01. All rights reserved.
//

#import "MCPersonInformationFooterView.h"

@interface MCPersonInformationFooterView ()

@property (nonatomic,strong)UIButton * btn_Save;

@end
@implementation MCPersonInformationFooterView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self createUI];
    }
    return self;
}



-(void)createUI{
    
    self.backgroundColor=[UIColor clearColor];
    //保存
    _btn_Save=[[UIButton alloc]init];
    [_btn_Save setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [_btn_Save setTitle:@"保存" forState:UIControlStateNormal];
    _btn_Save.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
    _btn_Save.contentEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0);
    [_btn_Save setBackgroundColor:RGB(80, 141, 207)];
    [self addSubview:_btn_Save];
    [_btn_Save addTarget:self action:@selector(action_Save) forControlEvents:UIControlEventTouchUpInside];
    _btn_Save.layer.cornerRadius=25.0;
    _btn_Save.clipsToBounds=YES;
    
    
    [self layOutConstraints];
    
}

/*
 * 点击 保存
 */
-(void)action_Save{
    
    if ([self.delegate respondsToSelector:@selector(MCPersonInformationFooter_Save)]) {
        [self.delegate MCPersonInformationFooter_Save];
    }
    
}

-(void)layOutConstraints{
    
    [_btn_Save mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.mas_left).offset(40);
        make.right.equalTo(self.mas_right).offset(-40);
        make.top.equalTo(self.mas_top).offset(50);
        make.bottom.equalTo(self.mas_bottom);
    }];
    
}

+(CGFloat)computeHeight:(id)info{
    return 100;
}


@end
